import Request from "../../core";

// 初始化WiFi信息
export const isBindWifi = (data) => {
  return Request.get("/wifi_app/shopHome/isBindWifi", data, {
    isLoading: false,
  });
};
//获取门店下面的WiFi
export const getShopWifiListByPubShopId = (data) => {
  return Request.get("/wifi_app/shopHome/getShopWifiListByPubShopId", data, {
    isLoading: false,
  });
};

// 初始化WiFi信息
export const geiWiFiQrcodeScan = (data) => {
  return Request.get("/wifi_anonApp/qrcodeScan", data, {
    // return Request.get("/wifi_app/qrcodeScan", data, {
    isLoading: false,
  });
};
//手机号查询匹配公域门店
export const getPubDomainShops = (data) => {
  return Request.get("/wifi_anonApp/getPubDomainShops", data, {
    // return Request.get("/wifi_app/getPubDomainShops", data, {
    isLoading: false,
  });
};
//WiFi绑定
export const wifiBind = (data) => {
  return Request.post("/wifi_anonApp/wifiBind", data, {
    // return Request.post("/wifi_app/wifiBind", data, {
    isLoading: true,
    callbackOptions: {
      // 返回选项
      errorAll: true, // 是否非成功请求将response body 全部返回
    },
  });
};
//获取我的绑定WiFi列表
export const myBindWifiList = (data) => {
  // return Request.get("/wifi_app/myWifiList", data, {
  return Request.get("/wifi_anonApp/myWifiList", data, {
    isLoading: false,
  });
};
//获取WiFi详情信息
export const getWiFiDetail = (data) => {
  // return Request.get("/wifi_app/getDetail", data, {
  return Request.get("/wifi_anonApp/getDetail", data, {
    isLoading: false,
  });
};
export const isBindByDeviceNo = (data) => {
  // return Request.get("/wifi_app/getDetail", data, {
  return Request.get("/wifi_appNoToken/isBindByDeviceNo", data, {
    isLoading: false,
  });
};
// WiFi信息编辑
export const editWifiConfig = (data) => {
  return Request.post("/wifi_anonApp/editWifiConfig", data, {
    // return Request.post("/wifi_app/editWifiConfig", data, {
    isLoading: true,
  });
};
// WiFi解绑
export const wifiUnbind = (data) => {
  // return Request.post("/wifi_app/wifiUnbind", data, {
  return Request.post("/wifi_anonApp/wifiUnbind", data, {
    isLoading: true,
  });
};

// WiFi广告
export const getAdvertByCurrentTime = (data) => {
  return Request.get("/wifi_anonApp/advert/getAdvertByCurrentTime", data, {
    isLoading: false,
  });
};
// WiFi广告点击
export const userClickAdvertCount = (data) => {
  return Request.post(
    `/wifi_app/advert/userClickAdvertCount?id=${data?.id}`,
    data,
    {
      isLoading: false,
    }
  );
};

// 经纬度获取附近门店WiFi
export const getNearByWifi = (data) => {
  return Request.get("/wifi_app/shopHome/getNearByWifi", data, {
    isLoading: false,
  });
};
//优惠券
export const pubAnonShelfList = (data) => {
  return Request.post("/couponAppOpen/coupon/pubAnonShelfList", data, {
    isLoading: false,
  });
  // return Request.post("/pub/couponMove/shelfList", data);
};
// 添加埋点数据记录
export const addWiFiRecord = (data) => {
  return Request.post("/wifi_anonApp/addRecord", data, {
    isLoading: false,
  });
};
